<?php
$arr = array
(
    -1 => array
    (
        'uid' => 1108157,
        'service_live' => 16,
        'dis' => 8
    ),
    1 => array
    (
        'uid' => 1108058,
        'service_live' => 16,
        'dis' => 25
    ),
    2 => array
    (
        'uid' => 1108058,
        'service_live' => 16,
        'dis' => 25
    ),
    3 => array
    (
        'uid' => 1108058,
        'service_live' => 16,
        'dis' => 25
    ),
    4 => array
    (
        'uid' => 1108058,
        'service_live' => 16,
        'dis' => 25
    ),
    5 => array
    (
        'uid' => 1107966,
        'service_live' => 16,
        'dis' => 27
    ),
    6 => array
    (
        'uid' => 1107966,
        'service_live' => 16,
        'dis' => 27
    ),
    7 => array
    (
        'uid' => 1108053,
        'service_live' => 16,
        'dis' => 27
    ),
    8 => array
    (
        'uid' => 1108053,
        'service_live' => 16,
        'dis' => 27
    ),
    9 => array
    (
        'uid' => 1107966,
        'service_live' => 16,
        'dis' => 27
    ),
    10 => array
    (
        'uid' => 1108053,
        'service_live' => 16,
        'dis' => 27
    ),
    11 => array
    (
        'uid' => 1108053,
        'service_live' => 16,
        'dis' => 27
    )
);
// uasort($arr, function($a, $b) {
      // return $a['service_live'] > $b['service_live'] ? -1: 1;
// });
$arr = array_sort($arr,"service_live","SORT_DESC");

print_r($arr);
?>

<?php
/**
 * 使用arort() 实现uasort() 好像没有什么意义
 */
function array_sort($array, $on, $order=SORT_ASC)
{
    $new_array = array();
    $sortable_array = array();

    if (0 == count($array) || !is_array($array)) {
        return $new_array;
    }

    foreach ($array as $k => $v) {
        $sortable_array[$k] = $v[$on] ?? '';
    }

    switch ($order) {
        case SORT_ASC:
            asort($sortable_array);
        break;
        case SORT_DESC:
            arsort($sortable_array);
        break;
    }

    foreach ($sortable_array as $k => $v) {
        $new_array[$k] = $array[$k];
    }

    return $new_array;
}
?>